package com.qqt.csr.common.exception;


public interface StatusCode {
	Integer getCode();

	String getMessage();
	


	public static final Common SUCCESS = Common.SUCCESS;
	public static final Common INTERNAL_SERVER_ERROR = Common.INTERNAL_SERVER_ERROR;
	public static final Common INTERNAL_DUBBO_ERROR = Common.INTERNAL_DUBBO_ERROR;
	public static final int OK = 200;

	enum Common implements StatusCode {
		SUCCESS(200, "请求已经成功处理"),
		INTERNAL_SERVER_ERROR(500, "网络异常，请稍后再试"),
		ILLEGAL(100400, "无效的{0}"),
		LOGIN_PASSWORD_ERROR(400, "账号密码错误"),
		FORBIDDEN(100403, "没有访问权限"),
		NULL_ERROR(100411, "{0}不能为空"),
		UNIQUE_ERROR(100412, "{0}已存在"),
		CONFIRM_ERROR(100413, "{0}不一致"),
		NOT_EXIST(100414, "{0}不存在"),
		VERIFY_ERROR(100415, "短信验证码错误"),
		DISABLE_ERROR(100416, "当前{0}已被禁用"),
		ILLEGAL_PARAM_ERROR(100417, "非法参数"),
		REPEATED_REQUEST_ERROR(100418, "重复请求"),
		REPEATED_PARAM_ERROR(100419, "{0}已重复"),
		CUSTOMIZE_ERROR_MESSAGE(100420, "{0}"),
		NO_TOKEN(100421, "没有权限或请登录后访问"),
		THIRD_API_ERROR(100422, "调用外部接口异常"),
		MQ_EXCEPTION(100423, "服务异常"),
		INTERRUPT_TASK(100425, "中断任务"),
		;

		private final Integer code;

		private final String message;

		private Common(int code, String message) {
			this.code = code;
			this.message = message;
		}

		@Override
		public Integer getCode() {
			return code;
		}

		@Override
		public String getMessage() {
			return message;
		}
		


	}

}
